package com.yytek.nmp.task;

import com.yytek.nmp.service.impl.IotDeviceStateServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 设备采集状态任务
 */
@Slf4j
@Component
public class DeviceStateTask {
    @Resource
    private IotDeviceStateServiceImpl iotdeviceStateService;
    /**
     * 定时批量更新设备状态任务
     */
    @Scheduled(cron = "${scheduling.deviceStateInsert:-}")
    public void deviceStateInsert() {
        log.info(">>>>>>>>>>>>>>>>>>定时批量更新设备状态任务开始执行");
        iotdeviceStateService.changeDeviceStateTask();
    }

    /**
     * 定时超时设备状态更新任务
     */
    @Scheduled(cron = "${scheduling.deviceStateOverdue:-}")
    public void deviceStateOverdue() {
        log.info(">>>>>>>>>>>>>>>>>>定时超时设备状态更新任务开始执行");
        iotdeviceStateService.deviceStateOverdue();
    }

}
